﻿using System;
using System.Collections.Generic;
using System.Text;
using Volo.Abp;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;

namespace mozhi.smarterp.Business.Sales
{
    public class SaleQuotationOrder : AuditedAggregateRoot<Guid> ,IMultiTenant
    {
        public Guid? TenantId { get; private set; }

        public Guid QuotationId { get; private set; }

        public Guid QuotationItemId { get; private set; }

        public Guid OrderId { get; private set; }

        public Guid OrderItemId { get; private set; }

        private SaleQuotationOrder() { }

        public SaleQuotationOrder(Guid id, Guid quotationId, Guid quotationItemId, Guid orderId, Guid orderItemId)
        {
            Id = id;
            QuotationId = quotationId;
            QuotationItemId = quotationItemId;
            OrderId = orderId;
            OrderItemId = orderItemId;

            Validate();
        }

        #region
        private void Validate()
        {
            Check.NotDefaultOrNull<Guid>(QuotationId, nameof(QuotationId));
            Check.NotDefaultOrNull<Guid>(QuotationItemId, nameof(QuotationItemId));
            Check.NotDefaultOrNull<Guid>(OrderId, nameof(OrderId));
            Check.NotDefaultOrNull<Guid>(OrderItemId, nameof(OrderItemId));
        }
        #endregion
    }
}
